package com.fy.consumer.controller;

import com.fy.common.api.CommonResult;
import com.fy.common.api.OperationCode;
import com.fy.common.pojo.Ticket;
import com.fy.common.util.BeansUtil;
import com.fy.consumer.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/consumer")
@Api(tags="消费者购买门票")
@RefreshScope
public class ConsumerPurchaseController {
    /**
     *
     * @param ticketId
     * @return com.fy.consumer.vo.TicketVo
     * @author Sun-qw
     * @date 2022/5/27 9:44
     */
    @ApiOperation("查询门票信息")
    @ApiImplicitParam(name = "ticketId", value = "门票id")
    @GetMapping(value = "/ticketFindByTicketId")
    public CommonResult ticketFindByTicketId(int ticketId)
    {
        Ticket ticket = null;
        return CommonResult.success(ticket);
    }

    /**
     * 
     * @param ticketId 
     * @return java.util.List<com.fy.consumer.vo.CalendarVo>
     * @author Sun-qw
     * @date 2022/5/27 10:07
     */
    @ApiOperation("查询门票价格日历")
    @GetMapping(value = "/calendarFindByTicketId")
    public CommonResult calendarFindByTicketId(int ticketId)
    {
        List<CalendarVo> calendarVoList = null;
        return CommonResult.success(calendarVoList);
    }

    /**
     * 
     * @param consumerId 
     * @return java.util.List<com.fy.consumer.vo.TravelerVo>
     * @author Sun-qw
     * @date 2022/5/27 11:10
     */
    @ApiOperation("查询traveler出行人")
    @GetMapping(value = "/findAllTravelerByConsumerId")
    public CommonResult findAllTravelerByConsumerId(int consumerId)
    {
        List<TravelerVo> travelerVoList = null;
        return CommonResult.success(travelerVoList);
    }

    /**
     * 
     * @param consumerId
    	 * @param addressVo 
     * @return com.fy.consumer.vo.AddressVo
     * @author Sun-qw
     * @date 2022/6/1 11:05
     */
    @ApiOperation("添加traveler出行人信息")
    @PostMapping(value = "/addTraveler")
    public CommonResult addTraveler(int consumerId,AddressVo addressVo)
    {
        return CommonResult.result(
                OperationCode.SUCCESS_REATE_TRAVELER_81000.getCode(),OperationCode.SUCCESS_REATE_TRAVELER_81000.getMessage());
    }

    /**
     * 
     * @param consumerId
    	 * @param travelerId 
     * @return com.fy.consumer.vo.AddressVo
     * @author Sun-qw
     * @date 2022/6/1 13:57
     */
    @ApiOperation("修改默认traveler出行人信息")
    @PostMapping(value = "/updateTravelerDefault")
    public CommonResult updateTravelerDefault(int consumerId,int travelerId)
    {
        AddressVo addressVo = null;
        return CommonResult.success(addressVo);
    }

    /**
     *
     * @param travelOrderVo
     * @return com.fy.consumer.vo.TravelOrderVo
     * @author Sun-qw
     * @date 2022/6/2 10:02
     */
    @ApiOperation("添加travel_order门票订单信息")
    @PostMapping(value = "/addTravelOrder")
    public CommonResult addTravelOrder(TravelOrderVo travelOrderVo)
    {
        return CommonResult.result(
                OperationCode.SUCCESS_CREATE_TRAVELERORDER_81300.getCode(),OperationCode.SUCCESS_CREATE_TRAVELERORDER_81300.getMessage()
        );
    }

    /**
     * 
     * @param travelOrderId 
     * @return com.fy.consumer.vo.TravelOrderVo
     * @author Sun-qw
     * @date 2022/6/2 10:20
     */
    @ApiOperation("通过消费者id查看travel_order订单")
    @GetMapping(value = "/travelOrderFindById")
    public CommonResult travelOrderFindById(int travelOrderId)
    {
        TravelOrderVo travelOrderVo = null;
        return CommonResult.success(travelOrderVo);
    }

    /**
     * 
     * @param consumerId 
     * @return java.util.List<com.fy.consumer.vo.ObjectOrderVo>
     * @author Sun-qw
     * @date 2022/6/2 10:20
     */
    @ApiOperation("查看消费者全部travel_order订单")
    @GetMapping(value = "/travelOrderFindByConsumerId")
    public CommonResult travelOrderFindByConsumerId(int consumerId)
    {
        List<ObjectOrderVo> objectOrderVoList = null;
        return CommonResult.success(objectOrderVoList);
    }


    /**
     * 
     * @param  
     * @return com.fasterxml.jackson.databind.util.JSONPObject
     * @author Sun-qw
     * @date 2022/5/25 18:23
     */
    @ApiOperation("查看门店门票")
    @GetMapping(value = "/findAllTicket")
    public CommonResult findAllTicket(int storeId)
    {
        List<TicketVo> ticketVoList = null;
        return CommonResult.success(ticketVoList);
    }
}
